import Cookies from "js-cookie";
//cookie存缓存
export const SetCookie = (name, cookie) => {
    Cookies.set(name, cookie)
}

//cookie取缓存
export const GetCookie = name => Cookies.get(name);

//cookie删缓存
export const RemoveCookie = name => {
    Cookies.remove(name)
}

//localStorage存缓存
export const setStore = (name, obj) => {
    window.localStorage.setItem(name, obj)
}

//localStorage取缓存
export const getStore = name => window.localStorage.getItem(name)

//localStorage删缓存
export const removeStore = name => {
    window.localStorage.removeItem(name);
}

//localStorage删除所有缓存
export const getClear = () => {
    window.localStorage.clear()
}

//SessionStorage存缓存
export const setSession = (name, obj) => {
    window.sessionStorage.setItem(name, obj)
}

//SessionStorage取缓存
export const getSession = name => window.sessionStorage.getItem(name)

//SessionStorage删缓存
export const removeSession = name => {
    window.sessionStorage.removeItem(name);
}